package com.heima.feigns;

import com.heima.config.HeimaFeignAutoConfiguration;
import com.heima.feigns.fallback.AdminFeignFallback;
import com.heima.model.admin.pojos.AdChannel;
import com.heima.model.common.dtos.ResponseResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;

import java.util.List;

@FeignClient(value = "leadnews-admin",fallbackFactory = AdminFeignFallback.class
        ,configuration = HeimaFeignAutoConfiguration.class)
public interface AdminFeign {


    @PostMapping("/api/v1/sensitive/sensitives")
    public ResponseResult<List<String>> queueAllSensitives();

    /**
     * 根据id查询频道
     * @param id
     * @return
     */
    @GetMapping("/api/v1/channel/one/{id}")
    public ResponseResult<AdChannel> findOne(@PathVariable Integer id);

    // ================新增接口方法  start ================

    /**
     * 频道列表展示---查询所有频道的数据
     * @return
     */
    @GetMapping("/api/v1/channel/channels")
    ResponseResult<List<AdChannel>> findAll();
    // ================新增接口方法  end ================

}
